﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace RadLogger_Pro
{
    public partial class RadMon_Connect : Form
    {
        public RadMon_Connect()
        {
            InitializeComponent();
        }

        private void RadMon_Connect_Load(object sender, EventArgs e)
        {
            RadMonUsernameLabel.Text = Properties.Settings.Default.RadMonUserName;
            RadMonUserPasswordLabel.Text = Properties.Settings.Default.RadMonUserPassword;
        }

        private void buttonSave_Click(object sender, EventArgs e)
        {
            if (RadMonUsernameLabel.Text != "")
            {
                if (RadMonUserPasswordLabel.Text != "")
                {
                    Properties.Settings.Default.RadMonUserName = RadMonUsernameLabel.Text;
                    Properties.Settings.Default.RadMonUserPassword = RadMonUserPasswordLabel.Text;
                    Properties.Settings.Default.Save();
                    MessageBox.Show("Settings have been saved.");
                    Close();
                }
                else
                {
                    MessageBox.Show("Please enter your password.");
                }
            }
            else
            {
                MessageBox.Show("Please enter your username.");
            }
        }

        private void buttonCancel_Click(object sender, EventArgs e)
        {
            Close();
        }
    }
}
